Optimizing execution of processes

ABSTRACT

Methods and system for optimizing an execution of a business process are disclosed. In one aspect, a request to execute a business process is received. The business process is executed on multiple threads, which may include multiple computations. The business process is optimized by determining an optimal number of threads for executing the business process by a thread optimization model. From the determined optimal number of threads, the computations in the threads may be distributed or reallocated iteratively by executing an inter-thread computations optimization model. Executing the thread optimization model and the inter-thread computations optimization model optimizes the execution of the business process.

BACKGROUND

Advancements in the field of technology have increased the demand forsystems and applications that support a diverse set of functions in anorganization. Such systems and applications may include execution ofcomplex algorithms and procedures to implement processes in theorganization. The execution of algorithms and procedures to implementprocesses may consume dedicated computing resources and may add to theoperational costs. Some of the processes may not be optimized, resultingin underutilization of the computing resources. In addition, optimizingprocesses such that the computing resources are effectively utilized maybe challenging.

BRIEF DESCRIPTION OF THE DRAWINGS

The claims set forth the embodiments with particularity. The embodimentsare illustrated by way of examples and not by way of limitation in thefigures of the accompanying drawings in which like references indicatesimilar elements. The embodiments, together with its advantages, may bebest understood from the following detailed description taken inconjunction with the accompanying drawings.

FIG. 1 is a block diagram illustrating process optimization system tooptimize the execution of business processes, according to anembodiment.

FIG. 2 is a flow diagram illustrating process to optimize an executionof a business process, according to an embodiment.

FIG. 3 is a flow diagram illustrating process to optimize an executionof a business process, according to an embodiment.

FIG. 4 is a flow diagram illustrating process to optimize an executionof a business process, according to an embodiment.

FIG. 5 is a block diagram illustrating an execution of a businessprocess, according to an embodiment.

FIG. 6 is a block diagram illustrating an execution of a businessprocess, according to an embodiment.

FIG. 7 is a block diagram illustrating an execution of a businessprocess, according to an embodiment.

FIG. 8 is a block diagram illustrating an execution of a businessprocess, according to an embodiment.

FIG. 9 is a block diagram of a computer system, according to anembodiment.

DETAILED DESCRIPTION

Embodiments of techniques related to optimizing execution of processesare described herein. In the following description, numerous specificdetails are set forth to provide a thorough understanding of theembodiments. One skilled in the relevant art will recognize, however,that the embodiments can be practiced without one or more of thespecific details, or with other methods, components, materials, etc. Inother instances, well-known structures, materials, or operations are notshown or described in detail.

Reference throughout this specification to “one embodiment”, “thisembodiment” and similar phrases, means that a particular feature,structure, or characteristic described in connection with the embodimentis included in at least one of the one or more embodiments. Thus, theappearances of these phrases in various places throughout thisspecification are not necessarily all referring to the same embodiment.Furthermore, the particular features, structures, or characteristics maybe combined in any suitable manner in one or more embodiments.

Business processes may refer to a collection of related activities ortasks. Such activities may be structured and may be associated with aspecific service or a product. A business process may include multiplesub-processes that may be executed to achieve a desired objective. Thesub-processes or the business process may be executed concurrently inparallel on multiple threads.

A thread on which a business process is executed, may be a component ofthe business process, and may include a sequence of programmedinstructions executed by a processor of a general purpose computer.Multiple threads may run or execute in parallel to execute the businessprocess and may share computing resources such as processor, memory,etc. Determining and allocating an optimal number of threads forexecuting a business process may contribute to optimizing the executionof the business process. Optimizing the execution of a business processmay include modifying an aspect of the process that makes it work moreefficiently by using fewer computing resources. By way of example,optimizing the execution of a business process may correspond toreducing an overall time required to execute the business process,reducing the amount of memory consumed or utilized to execute thebusiness process, etc.

FIG. 1 is a block diagram 100 illustrating process optimization system105 to optimize the execution of business processes, according to anembodiment. By way of illustration, FIG. 1 shows process optimizationsystem 105 that optimizes an execution of business processes (e.g.,process 1, process 2, process 3, process N, etc.). The processoptimization system 105 includes thread optimization module 110 andinter-thread computations optimization module 115 that may work inconjunction with each other to optimize the execution of the businessprocesses (e.g., process 1, process 2, process 3, process N, etc.).

In an embodiment, process optimization system 105 may optimize theexecution of the business process by thread optimization module 110 andinter-thread computations optimization module 115. When processoptimization system 105 receives a request to execute a business process(e.g., process 1), thread optimization module 110 may determine anoptimal number of threads required to execute the business process(e.g., process 1). Thread optimization module 110 may determineattributes, structure, number of computations, etc., associated with thebusiness process (e.g., process 1). The thread optimization module 110may iteratively calculate a total time required to execute computationsassociated with the business process (e.g., process 1) by incrementingnumber of threads (e.g., a thread count) to execute the computations inthe business process (e.g., process 1). In each iteration, the threadcount may be incremented, and the total time required to execute thecomputations in the business process (e.g., process 1) is calculated andcompared with the corresponding values (e.g., total lime required toexecute the computations, thread count, etc.) of the previousiterations. Based on the comparison, thread optimization module 110 maydetermine the optimal number of threads for executing the businessprocess (e.g., “process 1”).

In an embodiment, upon determining the optimal number of threadsrequired for executing the business process (e.g., process 1), theexecution of business process may further be optimized by inter-threadcomputations optimization module 115. The inter-thread computationsoptimization module 115 may determine a time required to create orgenerate a thread (e.g., a first thread) from the optimal number ofthreads and a total time required to execute the computations in thethread (e.g., the first thread). The computations in the optimal numberof threads may be partitioned into time slots such that each time slotand/or computation is equal to the time required to create the thread(e.g., the first thread).

In an embodiment, based on a determination of a total time required toexecute computations in the business process (e.g., “process 1”),inter-thread computations optimization module 115 may iterativelydetermine available free time slots in the optimal number of threads.The computations of the last thread from the optimal number of threadsmay be reallocated or distributed between the available free time slotsin the optimal number of threads. The reallocation or distribution ofthe computations may optimize the execution of the business process(e.g., “process 1”) by reducing the memory utilized and the total timerequired executing the business process.

FIG. 2 is a flow diagram illustrating process 200 to optimize anexecution of a business process, according to an embodiment. The process200 may include receiving a request to execute the business process. Thethreads may be independent subsets of the business process and mayinclude instructions related to computations or calculations that areassociated with the business process. In an embodiment, a request isreceived to execute a business process, at 210. The execution ofbusiness process may be optimized by an execution of multipleoptimization models. The execution of the optimization models may besequential and the order in which the optimization models may beexecuted may depend on the business process or may be defined by a user.

In an embodiment, the execution of the business process may be optimizedby executing a thread optimization model and an inter-threadcomputations optimization model. The thread optimization model may beexecuted to determine an optimal number of threads required forexecuting the process, at 220. Upon determining the optimal number ofthreads to execute the process, the inter-thread computationsoptimization model may be executed. The execution of inter-threadcomputations optimization model iteratively distributes computations inthe determined optimal number of threads, at 230. The distribution orreallocation of the computations may be based on business logic. By wayof example, the business logic may include iteratively parsing thethreads to determine whether: the computations in the threads may bereallocated; the computations in the threads are awaiting reallocation,etc. Based on the determined optimal number of threads and the iterativedistribution of the computations in the optimal number of threads, theexecution of the business process is optimized, at 240.

FIG. 3 is a flow diagram illustrating process 300 to optimize anexecution of a business process, according to an embodiment. In anembodiment, a business process may be optimized by an execution of athread optimization model that may determine an optimal number ofthreads required to execute the business process. The execution ofprocess 300 provides a mechanism to determine an optimal number ofthreads required for an execution of the business process.

In an embodiment, the execution of the thread optimization model maydetermine the attributes, structures, number of computations, etc.,associated with the business process. The determination of the optimalnumber of threads required for the execution of the business process maystart by a value for number of threads (e.g., thread count). Based onthe thread count, an overall time (e.g., total time) required to executethe computations in the threads may be determined. The total timerequired to execute the computations in the threads may be based onparameters, such as, number of computations in the thread, a timerequired or taken to create or generate the thread, time required ortaken for executing computations in the thread, fixed additionalprocessing time taken for each thread, etc. The total time required toexecute the computations associated with the business process iscalculated, at 310. The value of thread count is iterativelyincremented, at 320. Upon incrementing the thread count, the total timetaken to execute the computations for a corresponding value of thethread count may be calculated. By iteratively incrementing the threadcount, the total time required to execute the computations may bereduced. For each iteration, the thread count is incremented and thetotal time required to execute the computations in the business processis calculated. The calculated total time and a corresponding value ofthe thread count are compared for each iteration, at 330 (e.g., totaltime required to execute the computations, thread count, etc., of eachiteration is compared with the corresponding values of the previousiterations). Based on the comparison, the thread optimization module,determines the optimal number of threads for executing the businessprocess, at 340.

In an embodiment, consider ‘c’ representing a time required for eachcomputation in a thread ‘t’, then an total time required to create athread, may be computed using the equation:T=(t*n)+(c*i)+f  Equation (1)

In an embodiment, ‘n’ represents the number of threads; ‘i’ representsnumber of calculations or computations in thread ‘t’; and ‘f’ representsfixed additional processing time.

In an embodiment, when ‘n’ corresponds to a master thread (e.g., processis executed on a single thread) and there are no additional threads(e.g., child threads), then value of ‘n’ is ‘0’ (zero). Hence Equation(1) may be rewritten as:T=(c*N)+f  Equation (2)

In an embodiment, ‘N’ corresponds to ‘i’ which represents the number ofcomputations or calculations in the business process, in Equation (2).

By way of example, consider optimizing the execution of business process‘A’. In an embodiment, the business process ‘A’ may be optimized bydetermining an optimal number of threads required for its execution. Thetotal time required for executing the computations may be optimized orreduced by iteratively increasing the value of thread count andcalculating a corresponding total time required for the execution of thecomputations in the business process. In each iteration, the calculatedtotal time required for the execution of the computations may becompared with the corresponding value of total time required for theexecution of the computations in the previous iteration. The lowestvalue of the total time required for the execution of the computationsmay be determined and the corresponding value of the thread count may bedetermined. This determined value of the thread count may correspond tothe optimal number of threads required to execute the computations,thereby optimizing the execution of the business process ‘A.’

In an embodiment, consider that business process ‘A’ may be related todatabase operations. Consider that business process ‘A’ executes on amaster thread and does not include any additional threads (e.g., childthreads). Hence, the total time required to execute the computations inbusiness process ‘A’ may be calculated using Equation (2) and this valuemay represent the maximum total time required to execute thecomputations in business process ‘A’. The execution of the businessprocess ‘A’ may be optimized by iteratively incrementing the threadcount and calculating the corresponding value of the total time requiredfor executing the computations.

By way of example, consider the number of computations, ‘N’, as equal to100; the time required for each computation, ‘c’, as equal to 8 ms(milliseconds); and the fixed additional processing time required foreach thread, ‘f’ as equal to 89 ms. On substituting these values inEquation (2), the maximum total time ‘T’ required for the execution ofbusiness process ‘A’ may be computed as, T=889 ms.

In an embodiment, consider that the thread count associated with theexecution of the computations in business process ‘A’ is iterativelyincremented and the number of computations in each thread gets dividedbased on the number of thread count. Table 1 exemplarily illustratestotal time required to execute business process ‘A’ based on aniterative increment in the thread count and number of computations ineach thread.

TABLE 1 Thread Fixed Number of Compu- Total Thread Creation ProcessingComputations tation Time Index Count Time Time in each thread Time (T(I) (n) (t ms) (f ms) (i) (c ms) ms) I1 0 21 89 100 8 889 I2 2 21 89 508 531 I3 3 21 89 33.3 8 418.4 I4 4 21 89 25 8 373 I5 5 21 89 20 8 354 I66 21 89 16.7 8 348.6 I7 7 21 89 14.3 8 350.4 I8 8 21 89 12.5 8 357 I9 921 89 11.1 8 366.8 I10 10 21 89 10 8 377

In an embodiment, the columns of Table 1 includes attributes, such as,“INDEX”, “THREAD COUNT”, “THREAD CREATION TIME”, “FIXED PROCESSINGTIME”, “NUMBER OF COMPUTATIONS IN EACH THREAD”, “COMPUTATION TIME”,“TOTAL TIME”, etc. The rows of Table 1 includes corresponding attributevalues and the values in the column “TOTAL TIME” corresponds to thetotal time required for executing the computations in business process‘A’. Based on the attribute value of “THREAD COUNT,” the attributevalues of “TOTAL TIME” may be computed using Equation (1) or Equation(2). By way of example, the attribute value ‘0’ for “THREAD COUNT”corresponds to execution of the computations of the business process ‘A’on the master thread. The attribute value ‘2’, ‘3’, ‘4’, etc.,corresponds to execution of the computations of the business process ‘A’on multiple child threads.

By way of illustration, Table 1 shows that the attribute values in“TOTAL TIME” decreases or reduces, when the attribute value of “THREADCOUNT” is iteratively incremented. Based on an iterative increment(e.g., increment in value by 1) in the attribute value of “THREAD COUNT”and the corresponding number of computations, the total time required toexecute the computations in the business process ‘A’ may be calculated.In each iteration, the attribute value “TOTAL TIME” may be compared withits corresponding attribute value in the previous iteration. By way ofexample, the attribute value “TOTAL TIME” for “INDEX” ‘I2’ may becompared with the attribute value “TOTAL TIME” for “INDEX” ‘I1’ and soon.

In an embodiment, by iteratively incrementing the thread count,calculating the total time required for executing the computations,comparing the attribute values in “TOTAL TIME” for each iteration andidentifying the corresponding thread count, the optimal number ofthreads for execution of the business process ‘A’ may be determined. Byway of example, Table 1 shows that the attribute values in “TOTAL TIME”keeps decreasing with an increment of the thread count, that is, tillthe thread count reaches 6 (indicated by indices I1 to I6); upon furtherincrementing the thread count, the attribute value “TOTAL TIME” startsincreasing (indicated by indices I7 to I10). The attribute value “TOTALTIME” is lowest for the attribute value in “THREAD COUNT” 6 and startsincreasing when the attribute value in “THREAD COUNT” is incremented.Hence, it may be determined that the optimal number of threads forexecuting business process ‘A’ is 6. In an embodiment, the optimalnumber of threads may correspond to a minimum total time required toexecute the computations in business process ‘A’. The minimum total time(e.g., lowest total time) required to execute the business process ‘A’may be further reduced by execution of inter-thread optimization model,thereby optimizing the execution of business process ‘A’.

FIG. 4 is a flow diagram illustrating process 400 to optimize anexecution of a business process, according to an embodiment. In anembodiment, an execution of business process may be optimized by anexecution of an inter-thread computations optimization model. Theinter-thread computations optimization model may iteratively distributeor reallocate computations between the optimal number of threads (e.g.,determined by thread optimization model) that is associated with thebusiness process and running concurrently in parallel. The execution ofprocess 400 provides a mechanism to iteratively distribute or reallocatecomputations between the optimal number of threads executing thebusiness process ‘A’.

In an embodiment, by iteratively reallocating the computations betweenthe determined optimal number of threads, the execution of the businessprocess ‘A’ may be optimized. As explained previously, the optimalnumber of threads required for executing the computations of businessprocess ‘A’ may be determined by thread optimization model. Each threadmay be created or generated serially. The execution of business process‘A’ may be further optimized by iteratively distributing or reallocatingthe computations between the optimal number of threads. In anembodiment, the computations in each thread from the optimal number ofthreads may be independent and reallocating the computations of onethread may not interrupt its own execution. The time required forexecuting each computation in each thread may be less than the timerequired for creating the thread itself. To reallocate the computationsbetween the optimal number of threads, a time required to create athread (e.g., a first thread) and a total time required to executecomputations in the first thread is determined, at 410. Upon suchdetermination, the computations in the first thread may be partitionedor divided into time slots. Each time slot may correspond to the timetaken to create the thread.

In an embodiment, based on the time slots (e.g., partitions) created inthe first thread, the computations in the optimal number of threads arepartitioned into time slots, at 420. The time slot in each thread may beequal to the time taken to create the thread. In an embodiment, uponcreating partitions in the optimal number of threads, a total timerequired to execute the computations in the last thread, may bedetermined. The total time required to execute the computations in thefirst thread, a second thread, a third thread, etc., may be less thanthe total time required to execute the computations in the last thread(e.g., in the optimal number of threads, the threads may be referred toas first thread, second thread, last thread, etc.).

In an embodiment, the execution of the business process ‘A’ is completedwhen the computations in the last thread is completed. In an embodiment,the execution of the computations in the first thread, second thread,etc., may be completed before the creation of the last thread (e.g.,based on number of computations and time taken for execution of eachcomputation). Since execution of the computations in the last threadcompletes the execution of the business process ‘A’, there may be freetime slots available between the first thread and a second last thread.An iterative determination of such available free time slots in theoptimal number of threads is made based on the total time required toexecute the computations in the last thread, at 430. The availability offree time slots may be iteratively determined by parsing the threads andidentify or determine the time taken to complete the execution of thecomputations. Upon such determination, the computations from the lastthread may be reallocated to the available free time slots in theoptimal number of threads to optimize the execution of business process‘A’, at 440. Such reallocation may reduce the total time required toexecute the computations associated with the business process ‘A’.

In an embodiment, when all the computations of the last thread areiteratively reallocated between the first thread and the second lastthread, the last thread may be released from business process ‘A’. Themechanism to determine the available free time slots in the optimalnumber of threads and reallocate or distribute of the computationsbetween the optimal number of threads may continue iteratively until theall the computations that are waiting to be reallocated are distributedbetween the optimal number of threads.

In an embodiment, when an availability of a free time slot is determinedin higher order threads (e.g., first thread, second thread, etc.), thenthe computations in lower order threads (e.g., last thread, second lastthread, etc.) may be iteratively distributed or reallocated between thehigher order threads. Since the time taken for executing computations inthe higher order threads may greater than that in the lower orderthreads, reallocation or distribution of the computations reduces thetotal time required to complete execution, thereby optimizing theexecution of the business process.

FIG. 5 is a block diagram 500 illustrating an execution of a businessprocess, according to an embodiment. By way of illustration, FIG. 5shows an execution of a business process ‘A’ on an optimal number ofthreads. As explained previously, the optimal number of threads requiredto execute the computations of the business process ‘A’ may bedetermined by an execution of a thread optimization model. The X-axisrepresents the Time (in milliseconds) and Y-axis represents the threadnumber (e.g., Thread No). FIG. 5 shows the execution of business process‘A’ on 6 threads (e.g., representing optimal number of threads) that arecreated serially. By way of example, each thread may include 5computations (e.g., computations in thread 1 are indicated by ‘1.1’,‘1.2’, ‘1.3’, ‘1.4’, ‘1.5’; computations in thread 2 are indicated by‘2.1’, ‘2.2’, ‘2.3’, ‘2.4’, ‘2.5’, and so on). The time taken to createeach thread is 10 ms and each thread may be partitioned into time slotsof 10 ms, which represents the time taken for executing a computation inthe thread (e.g., each time slot may correspond to the time taken tocreate thread, which is equal to the time taken to execute a computationin the thread). By way of illustration, FIG. 5 shows that the total timetaken to complete execution of the business process is 110 ms, whichcorresponds to the lime taken by the last thread (e.g., thread 6) tocomplete executing computations. The threads numbered 1, 2, 3, etc., maycomplete executing computations in less than 110 ms. By way of example,the time taken to complete execution of computations in each thread isapproximately 60 ms (e.g., for thread numbered 1, the time taken tocomplete execution of computations is 0 ms to 60 ms), which includes thetime taken to create the thread (represented by solid block at thebeginning of the thread in FIG. 5) and the execution of the computationsin the thread (represented by shaded blocks in FIG. 5). By way ofillustration, the first thread (e.g., thread 1) completes execution at60 ms; the second thread (e.g., thread 2) completes execution at 70 msand so on. The blocks or slots that correspond to time taken to createthe thread and execute the computations are indicated by legend 502.

FIG. 6 is a block diagram 600 illustrating an execution of a businessprocess, according to an embodiment. By way of illustration, FIG. 6shows the execution of business process ‘A’ on 6 threads. The X-axisrepresents the Time (in milliseconds) and Y-axis represents the threadnumber (e.g., Thread No). As explained above, the maximum total timerequired to complete the execution of business process ‘A’ may bedetermined by identifying the time required for executing thecomputations in the last thread, which is 110 ms, as shown in FIG. 6. Byway of illustration, FIG. 6 also shows that the first thread completesexecuting computations at 60 ms, the second thread at 70 ms, and so on.From the remaining optimal number of threads (e.g., in threads 1, 2, 3,4, 5), the availability of free time slots may be determined. By way ofexample, FIG. 6 shows availability of 5 free time slots in thread 1indicated by ‘A’, ‘B’, ‘D’, ‘G’, and ‘K’; availability of 4 free timeslots in thread 2 indicated by ‘C’, ‘E’, ‘H’, and ‘L’, and so on. Legend602 in FIG. 6 shows the thread creation, which corresponds to the timetaken or required to create a thread; computations, which corresponds tothe time taken to execute a computation; available free time slots,which corresponds to the number of available free time slots.

In an embodiment, Table 2 exemplarily illustrates the available freetime slots in the threads for execution of the business process.

TABLE 2 Thread Available free time slots Indicator 6 0 — 5 1 ‘O’ 4 2‘J’, ‘N’ 3 3 ‘F’, ‘I’, ‘M’ 2 4 ‘C’, ‘E’, ‘H’, ‘L’ 1 5 ‘A’, ‘B’, ‘D’,‘G’, ‘K’ Total 15

By way of illustration, Table 2 shows the “AVAILABLE FREE TIME SLOTS”,corresponding “THREAD” and “INDICATOR” information. Table 2 is generatedbased on available free time slots in each thread. In an embodiment,based on the time taken for executing computations in the last thread(e.g., thread 6), the availability of free time slots in the optimalnumber of threads may be iteratively determined. In the example above,it may be iteratively determined that there are a total of 15 free timeslots available between the first thread (e.g., thread 1) and the secondlast thread (e.g., thread 5). Upon such determination, the computationsof the last thread (e.g., thread 6) may be distributed or reallocated inthe available free time slots between the first thread (e.g., thread 1)and the second last thread (e.g., thread 5) by executing inter-threadcomputations optimization model.

In an embodiment, the number of available free time slots is based onthe optimal number of threads required for executing the computations inthe business process. For instance, if ‘k’ is the number of optimalnumber of threads required for executing the computations in thebusiness process, then the number of available free time slots may bedetermined by computing summation of free time slots between the firstthread and (k−1) threads. In general, sum of first ‘n’ natural integers‘S’ may be computed using the formula:

$\begin{matrix}{S = \frac{n*\left( {n + 1} \right)}{2}} & {{Equation}\mspace{14mu}(3)}\end{matrix}$

In an embodiment, if ‘a’ is the number of available free time slots,then substituting ‘n’ with (k−1) in Equation (3), yields:

$\begin{matrix}{a = \frac{k*\left( {k - 1} \right)}{2}} & {{Equation}\mspace{14mu}(4)}\end{matrix}$

FIG. 7 is a block diagram 700 illustrating an execution of a businessprocess, according to an embodiment. By way of illustration, FIG. 7shows reallocation or distribution of computations of the last thread(e.g., thread 6) between the first thread (e.g., thread 1) and thesecond thread (e.g., thread 2) by an execution of inter-threadcomputations optimization model. The X-axis represents the Time (inmilliseconds) and Y-axis represents the thread number (e.g., Thread No).By way of illustration, FIG. 7 shows that the computations of the lastthread (e.g., thread 6) indicated by ‘6.1’, ‘6.2’, ‘6.3’, ‘6.4’ and‘6.5’ are distributed or reallocated between the available free timeslots in thread 1 and the thread 2 (e.g., computation of thread 6indicated by ‘6.1’ gets reallocated in thread 1, at 704; computation ofthread 6 indicated ‘6.2’ gets reallocated in thread 1, at 706;computation of thread 6 indicated by ‘6.4’ gets reallocated in thread 1,at 708; computation of thread 6 indicated by ‘6.3’ gets reallocated inthread 2, at 706; computation of thread 6 indicated by ‘6.5’ getsreallocated in thread 2, at 708, etc.) In an embodiment, since all thecomputations in thread 6 are reallocated, thread 6 may be released fromparticipating in the execution of the business process. The reallocationof the computations from thread 6 reduces the total time required forthe execution of business process to 100 ms. Hence the total timerequired for the execution of business process is decreased by 10 ms andthe optimal number of threads is reduced by 1 thread, thereby optimizingthe execution of the business process by using 5 threads.

In an embodiment, upon releasing the last thread (e.g.; thread 6) fromparticipating in the execution of the business process, it may bedetermined that the total number of free time slots that are availableis reduced to 10. By way of illustration, FIG. 7 shows the time slotsindicated by ‘K’, ‘L’, ‘M’, ‘N’ and ‘O’ are lost (e.g., lost time slots)as the result of releasing thread 6, thereby reducing the number ofavailable free time slots to 10. In an embodiment, any furtherreallocation of the computations may result in releasing more threads(e.g., the second last thread, thread 5) from participating in theexecution of the business process. In such a scenario, the inter-threadcomputations optimization model may determine that reallocations ordistribution of the computations in the optimal number of threads maynot be possible and the mechanism to reallocate computations stops.Legend 702 in FIG. 7 shows the thread creation, which corresponds to thetime taken or required to create a thread; computations, whichcorresponds to the time taken to execute a computation; reallocatedcomputations, which corresponds to the computations that arereallocated; available free time slots, which corresponds to the numberof available free time slots; released thread, which corresponds to thethread that is released from participation in the execution of thebusiness process; and lost time slots, which corresponds to the timeslots that are lost as the result of releasing thread.

In an embodiment, when the computations in the second last thread (e.g.,thread 5) are reallocated or distributed among the remaining availablefree time slots (e.g., between thread 2 and thread 4, indicated by ‘G’,‘H’, ‘F’, ‘I’ and ‘J’) and the second last thread (e.g., thread 5) isreleased from participation in the execution of business process, it mayresult in losing 4 more time slots (e.g., when thread 5 is released fromparticipating in the business process, time slots indicated by ‘G’, ‘H’,‘I’ and ‘J’ may be lost). This may result in loss of the computations inthe remaining optimal number of threads (e.g., between thread 1 andthread 4). Hence the process of iteratively distributing or reallocatingthe computations between the optimal number of threads may be stopped.

FIG. 8 is a block diagram 800 illustrating an execution of a businessprocess, according to an embodiment. By way of illustration, FIG. 8shows partial reallocation or distribution of computations in theoptimal number of threads. The X-axis represents the Time (inmilliseconds) and Y-axis represents the thread number (e.g., Thread No).In an embodiment, the computations of the second last thread (e.g.,thread 5) indicated by ‘5.5’ may be partially reallocated (e.g.,computation of thread 5 indicated by ‘5.5’, at 804 gets reallocatedthread 3, at 806). Upon partial reallocation of the computation ‘5.5’,the times slots at 808 indicated by ‘G’, ‘H’, ‘I’, ‘J’ and (e.g., ‘5.5’at 804) may be released from participating in the execution of thebusiness process. In such a scenario, the total time required for theexecution of the business process may further be reduced by 10 ms,thereby optimizing the execution of the business process. Legend 802 inFIG. 8 shows the thread creation, that corresponds to the time taken orrequired to create a thread; computations, that corresponds to the timetaken to execute a computation; reallocated computations, thatcorresponds to the computations that are reallocated; available freetime slots, that corresponds to the number of available free time slots;released thread, that corresponds to the thread that is released fromparticipation in the execution of the business process; and lost timeslots, that corresponds to the time slots that are lost as the result ofreleasing thread.

By way of example, consider a scenario that the business process isexecuted using static or fixed number of threads (e.g., thread count ofn=1; n=2000 and n=5000). For instance, consider that number ofcomputations in each thread, ‘i’ is 8; fixed additional processing time,‘f’ is 89 ms and time taken to create the thread, ‘t’ is 21 ms; andmemory used by each thread is about 500 KB (kilobytes), then the totaltime required for the execution of business process may be computedusing Equation (1) and Equation (2), as follows:

Case 1:

-   -   When number of threads, n=1, the total time required for        executing the business process may be computed using Equation        (2), as

$\quad\begin{matrix}{T = {\left( {1000*8} \right) + 89}} \\{= {8.089\mspace{11mu}{ms}}}\end{matrix}$

Memory required for executing computations in 1 thread is 500 KB

$\quad\begin{matrix}{{{Total}\mspace{14mu}{memory}\mspace{14mu}{required}} = \left( {500*1} \right)} \\{= {500\mspace{11mu}{KB}}}\end{matrix}$

Case 2:

-   -   When number of threads, n=2000, the total time required for        executing the business process may be computed using Equation        (1), as

$\quad\begin{matrix}{T = {\left( {2000*21} \right) + \left( {500*8} \right) + 89}} \\{= {46.089\mspace{11mu}{ms}}}\end{matrix}$

Memory required for executing computations in 1 thread is 500 KB

$\quad\begin{matrix}{{{Total}\mspace{14mu}{memory}\mspace{14mu}{required}} = \left( {500*2000} \right)} \\{= {976.56\mspace{11mu}{MB}}}\end{matrix}$

Case 3:

-   -   When number of threads, n=5000, the total time required for        executing the business process may be computed using Equation        (1), as

$\quad\begin{matrix}{T = {\left( {5000*21} \right) + \left( {200*8} \right) + 89}} \\{= {106.689\mspace{14mu}{seconds}}}\end{matrix}$

Memory required for executing computations in 1 thread is 500 KB

$\quad\begin{matrix}{{{Total}\mspace{14mu}{memory}\mspace{14mu}{required}} = \left( {500*5000} \right)} \\{= {2441.4\mspace{11mu}{MB}}}\end{matrix}$

By way of example, consider Table 2 exemplarily illustrating calculatingtotal time required to execute business process using the threadoptimization model, where the thread count it iteratively incremented.

TABLE 2 Thread Fixed Crea- Proc- Number of Compu- Total Thread tionessing Computations tation Time Index Count Time Time in each threadTime (T (I) (n) (t ms) (f ms) (i) (c ms) ms) I1 610 21 89 1639.344262 826013.75 I2 611 21 89 1636.661211 8 26013.29 I3 612 21 89 1633.986928 826012.9 I4 613 21 89 1631.32137 8 26012.57 I5 614 21 89 1628.664495 826012.32 I6 615 21 89 1626.01626 8 26012.13 I7 616 21 89 1623.376623 826012.01 I8 617 21 89 1620.745543 8 26011.96 I9 618 21 89 1618.122977 826011.98 I10 619 21 89 1615.508885 8 26012.07 I11 620 21 89 1612.9032268 26012.23 I12 621 21 89 1610.305958 8 26012.45 I13 622 21 891607.717042 8 26012.74 I14 623 21 89 1605.136437 8 26013.09 I15 624 2189 1602.564103 8 26013.51 I16 625 21 89 1600 8 26014

According to Table 2, the attribute values in “TOTAL TIME” decreases orreduces when the attribute value of “THREAD COUNT” is iterativelyincremented by ‘1’, and is based on the number of computations. Thetotal time required to execute the computations in the business processmay be calculated using Equation (1) and Equation (2). As explainedpreviously, for each iteration, the attribute value “TOTAL TIME” may becompared with its corresponding attribute value in the previousiteration and the optimal number of threads for the execution ofbusiness process may be determined.

In an embodiment, by the execution of thread optimization model, it maybe determined that the optimal number of threads for executing thebusiness process may be determined as 617 (e.g., corresponding to lowestvalue of “TOTAL TIME”, indicated by “INDEX” I8) and the correspondingtotal time for executing the computations as 26011.96 ms. For this valueof thread count, the total memory required for executing computationsmay be computed as:

Memory required for executing computations in 1 thread is 500 KB

$\quad\begin{matrix}{{{Total}\mspace{14mu}{memory}\mspace{14mu}{required}} = \left( {500*617} \right)} \\{= {301.27\mspace{11mu}{MB}\mspace{14mu}\left( {{Megabytes}\text{)}} \right.}}\end{matrix}$

In an embodiment, the execution of the business process may further beoptimized by executing the inter-thread computations optimization model,which iteratively distributes or reallocates the computations in theoptimal number of threads. By way of example, Table 3 exemplarilyillustrates execution of inter-thread computations optimization modelthat may iteratively reduce the thread count by iteratively reallocatingor distributing the computations between the optimal number of threadsrequired for executing the business process.

TABLE 3 Number Optimal Compu- Con- of number Available tations tinuethreads of free time Reallocated awaited for Iter- Index reduced threadsslots computations Reallocation ation I1 161 617 103740 99176 4564 YesI2 162 617 103285 99792 3493 Yes I3 163 617 102831 100408 2423 Yes I4164 617 102378 101024 1354 Yes I5 165 617 101926 101640 286 Yes I6 166617 101475 102256 −781 No

Table 3 shows columns representing attributes, such as, “INDEX”, “NUMBEROF THREADS REDUCED”, “OPTIMAL NUMBER OF THREADS”, “AVAILABLE FREE TIMESLOTS”, “REALLOCATED COMPUTATIONS”, “COMPUTATIONS AWAITED FORREALLOCATION”, “CONTINUE ITERATION”, etc. The attribute values of“NUMBER OF THREADS REDUCED” are iteratively incremented and thecorresponding attribute values of “AVAILABLE FREE TIME SLOTS”,“REALLOCATED COMPUTATIONS”, and “COMPUTATIONS AWAITED FOR REALLOCATION”are determined. It may be noted that the attribute values of“COMPUTATIONS AWAITED FOR REALLOCATION” iteratively decrease in value,with an increment in the value of “NUMBER OF THREADS REDUCED” (e.g.,corresponding to indices I1 to I5). Based on the value of “COMPUTATIONSAWAITED FOR REALLOCATION”, the reduced thread count (e.g., “NUMBER OFTHREADS REDUCED”) may be determined. The iterations may be stopped, whenthere are no more computations left for reallocation. By way of example,Table 3 shows that value of “COMPUTATIONS AWAITED FOR REALLOCATION”becomes negative and it may be determined that the value of thread count(e.g., maximum number of threads) that may be reduced is 165 (e.g.,corresponding to “INDEX” I5).

In an embodiment, upon determining a value that corresponds to themaximum number of threads that may be reduced, the thread count forexecuting the business process may be determined. For instance, thevalue of maximum number of threads that may be reduced may be subtractedfrom the optimal number of threads required for the execution of thebusiness process. Therefore, the number of threads required forexecuting the business process may be computed to be equal to adifference between the optimal number of threads required for executingthe business process and the number of threads reduced, represented by:

$\begin{matrix}{{\left( {{optimal}\mspace{14mu}{number}\mspace{14mu}{of}\mspace{14mu}{threads}\mspace{14mu}{for}\mspace{14mu}{executing}\mspace{14mu}{the}\mspace{14mu}{business}\mspace{14mu}{process}} \right) - \left( {{number}\mspace{14mu}{of}\mspace{14mu}{threads}\mspace{14mu}{reduced}} \right)} = {{617 - 165} = 442}} & {{Equation}\mspace{14mu}(5)}\end{matrix}$

In an embodiment, using the value of thread count obtained from Equation(5), the total time required and the memory utilized for executing thebusiness process may be computed as follows:

-   -   When number of threads, n=442, the total time required for        executing the business process may be computed using Equation        (1), as

$\quad\begin{matrix}{T = {\left( {5000*21} \right) + \left( {1620.746*8} \right) + 89}} \\{= {22.33698\mspace{14mu}{ms}}}\end{matrix}$

Memory required for executing computations in 1 thread is 500 KB

$\quad\begin{matrix}{{{Total}\mspace{14mu}{memory}\mspace{14mu}{required}} = \left( {442*5000} \right)} \\{= {215.82\mspace{14mu}{MB}}}\end{matrix}$

In an embodiment, by executing the thread optimization model andinter-thread computations optimization model, the number of threadsrequired for executing the business process may be reduced. Theexecution of the above models, not only optimizes the execution of thebusiness process, but also reduces the computing resources utilized.

Some embodiments may include the above-described methods being writtenas one or more software components. These components, and thefunctionality associated with each, may be used by client, server,distributed, or peer computer systems. These components may be writtenin a computer language corresponding to one or more programminglanguages such as, functional, declarative, procedural, object-oriented,lower level languages and the like. They may be linked to othercomponents via various application programming interfaces and thencompiled into one complete application for a server or a client.Alternatively, the components may be implemented in server and clientapplications. Further, these components may be linked together viavarious distributed programming protocols. Some example embodiments mayinclude remote procedure calls being used to implement one or more ofthese components across a distributed programming environment. Forexample, a logic level may reside on a first computer system that isremotely located from a second computer system containing an interfacelevel (e.g., a graphical user interface). These first and secondcomputer systems can be configured in a server-client, peer-to-peer, orsome other configuration. The clients can vary in complexity from mobileand handheld devices, to thin clients and on to thick clients or evenother servers.

The above-illustrated software components are tangibly stored on acomputer readable storage medium as instructions. The term “computerreadable storage medium” should be taken to include a single medium ormultiple media that stores one or more sets of instructions. The term“computer readable storage medium” should be taken to include anyphysical article that is capable of undergoing a set of physical changesto physically store, encode, or otherwise carry a set of instructionsfor execution by a computer system which causes the computer system toperform any of the methods or process steps described, represented, orillustrated herein. A computer readable storage medium may be anon-transitory computer readable storage medium. Examples of anon-transitory computer readable storage media include, but are notlimited to: magnetic media, such as hard disks, floppy disks, andmagnetic tape; optical media such as CD-ROMs, DVDs and holographicdevices; magneto-optical media; and hardware devices that are speciallyconfigured to store and execute, such as application-specific integratedcircuits (“ASICs”), programmable logic devices (“PLDs”) and ROM and RAMdevices. Examples of computer readable instructions include machinecode, such as produced by a compiler, and files containing higher-levelcode that are executed by a computer using an interpreter. For example,an embodiment may be implemented using Java, C++, or otherobject-oriented programming language and development tools. Anotherembodiment may be implemented in hard-wired circuitry in place of, or incombination with machine readable software instructions.

FIG. 9 is a block diagram of an exemplary computer system 900, accordingto an embodiment. Computer system 900 includes processor 905 thatexecutes software instructions or code stored on computer readablestorage medium 955 to perform the above-illustrated methods. Processor905 can include a plurality of cores. Computer system 900 includes mediareader 940 to read the instructions from computer readable storagemedium 955 and store the instructions in storage 910 or in random accessmemory (RAM) 915. Storage 910 provides a large space for keeping staticdata where at least some instructions could be stored for laterexecution. According to some embodiments, such as some in-memorycomputing system embodiments, RAM 915 can have sufficient storagecapacity to store much of the data required for processing in RAM 915instead of in storage 910. In some embodiments, all of the data requiredfor processing may be stored in RAM 915. The stored instructions may befurther compiled to generate other representations of the instructionsand dynamically stored in RAM 915. Processor 905 reads instructions fromRAM 915 and performs actions as instructed. According to one embodiment,computer system 500 further includes output device 925 (e.g., a display)to provide at least some of the results of the execution as outputincluding, but not limited to, visual information to users and inputdevice 930 to provide a user or another device with means for enteringdata and/or otherwise interact with computer system 900. Each of theseoutput devices 925 and input devices 930 could be joined by one or moreadditional peripherals to further expand the capabilities of computersystem 900. Network communicator 935 may be provided to connect computersystem 900 to network 950 and in turn to other devices connected tonetwork 950 including other clients, servers, data stores, andinterfaces, for instance. The modules of computer system 900 areinterconnected via bus 945. Computer system 900 includes a data sourceinterface 920 to access data source 960. Data source 960 can be accessedvia one or more abstraction layers implemented in hardware or software.For example, data source 960 may be accessed by network 950. In someembodiments data source 960 may be accessed via an abstraction layer,such as, a semantic layer.

A data source is an information resource. Data sources include sourcesof data that enable data storage and retrieval. Data sources may includedatabases, such as, relational, transactional, hierarchical,multi-dimensional (e.g., OLAP), object oriented databases, and the like.Further data sources include tabular data (e.g., spreadsheets, delimitedtext files), data tagged with a markup language (e.g., XML data),transactional data, unstructured data (e.g., text files, screenscrapings), hierarchical data (e.g., data in a file system, XML data),files, a plurality of reports, and any other data source accessiblethrough an established protocol, such as, Open Data Base Connectivity(ODBC), produced by an underlying software system (e.g., ERP system),and the like. Data sources may also include a data source where the datais not tangibly stored or otherwise ephemeral such as data streams,broadcast data, and the like. These data sources can include associateddata foundations, semantic layers, management systems, security systemsand so on.

In the above description, numerous specific details are set forth toprovide a thorough understanding of embodiments. One skilled in therelevant art will recognize, however that the embodiments can bepracticed without one or more of the specific details or with othermethods, components, techniques, etc. In other instances, well-knownoperations or structures are not shown or described in details.

Although the processes illustrated and described herein include seriesof steps, it will be appreciated that the different embodiments are notlimited by the illustrated ordering of steps, as some steps may occur indifferent orders, some concurrently with other steps apart from thatshown and described herein. In addition, not all illustrated steps maybe required to implement a methodology in accordance with the one ormore embodiments. Moreover, it will be appreciated that the processesmay be implemented in association with the apparatus and systemsillustrated and described herein as well as in association with othersystems not illustrated.

The above descriptions and illustrations of embodiments, including whatis described in the Abstract, is not intended to be exhaustive or tolimit the one or more embodiments to the precise forms disclosed. Whilespecific embodiments of, and examples for, the one or more embodimentsare described herein for illustrative purposes, various equivalentmodifications are possible within the scope, as those skilled in therelevant art will recognize. These modifications can be made in light ofthe above detailed description. Rather, the scope is to be determined bythe following claims, which are to be interpreted in accordance withestablished doctrines of claim construction.

What is claimed is:
 1. A computer-implemented method to optimize anexecution of a business process, comprising: receiving a request toexecute a business process; upon receiving the request, determining, bya processor of the computer, an optimal number of threads for executingthe business process by a thread optimization model; iterativelydistributing, by the processor of the computer, one or more computationsin the determined optimal number of threads by an inter-threadoptimization model, comprising: determining a time required to generatea first thread from the optimal number of threads, and a total timerequired to execute one or more computations in the generated firstthread; and partitioning the one or more computations in the generatedfirst thread into one or more time slots, wherein the one or more timeslots are at least equal to the time required to generate the firstthread; and based on the determined optimal number of threads and theiterative distribution of the one or more computations, optimizing, bythe processor of the computer, the execution of the business process. 2.The computer-implemented method of claim 1, wherein determining theoptimal number of threads for executing the business process by thethread optimization model, comprises: calculating, by the processor ofthe computer, a total time required to execute one or more computationsassociated with the business process by iteratively incrementing a valueof a thread count for executing the business process; and for eachiteration, comparing, by the processor of the computer, the calculatedtotal time and a corresponding value of the thread count to determinethe optimal number of threads for executing the business process.
 3. Thecomputer-implemented method of claim 2, wherein the calculated totaltime corresponds to a lowest total time required for executing the oneor more computations associated with the business process.
 4. Thecomputer-implemented method of claim 1, wherein iteratively distributingthe one or more computations in the determined optimal number of threadsby inter-thread optimization model, further comprises: based on a totaltime required to execute the one or more computations in a last thread,iteratively determining, by the processor of the computer, one or moreavailable free time slots in the optimal number of threads; andreallocating, by the processor of the computer, the one or morecomputations from the last thread between the one or more available freetime slots in the optimal number of threads, wherein the reallocationoptimizes the execution of the business process.
 5. Thecomputer-implemented method of claim 1, further comprising: releasingthe last thread, by the processor of the computer, from the optimalnumber of threads upon determining that the one or more computationscorresponding to the last thread are iteratively distributed between aremaining optimal number of threads.
 6. The computer-implemented methodof claim 1, wherein the total time required to execute the one or morecomputations is based on the one or more computations in one or morethreads corresponding to the determined optimal number of threads.
 7. Acomputer system to optimize an execution of a business process,comprising: a processor; and one or more memory devices communicativelycoupled with the processor and the one or more memory devices storinginstructions to: receive a request to execute a business process;determine an optimal number of threads for executing the businessprocess by a thread optimization model; and iteratively distribute oneor more computations in the determined optimal number of threads by aninter-thread optimization model, comprising: determining a time requiredto generate a first thread from the optimal number of threads, and atotal time required to execute one or more computations in the generatedfirst thread; and partitioning the one or more computations in thegenerated first thread into one or more time slots, wherein the one ormore time slots are at least equal to the time required to generate thefirst thread; and based on the determined optimal number of threads andthe iterative distribution of the one or more computations, optimize theexecution of the business process.
 8. The computer system of claim 7,wherein determining the optimal number of threads for executing thebusiness process by the thread optimization model, comprises:calculating a total time required to execute one or more computationsassociated with the business process by iteratively incrementing a valueof a thread count for executing the business process; and for eachiteration, comparing the calculated total time and a corresponding valueof the thread count to determine the optimal number of threads forexecuting the business process.
 9. The computer system of claim 8,wherein the calculated total time corresponds to a lowest total timerequired for executing the one or more computations associated with thebusiness process.
 10. The computer system of claim 7, whereiniteratively distributing the one or more computations in the determinedoptimal number of threads by inter-thread optimization model, comprises:determining a time required to generate a first thread from the optimalnumber of threads, and a total time required to execute the one or morecomputations in the generated first thread; and partitioning the one ormore computations in the optimal number of threads into one or more timeslots, wherein the one or more time slots are equal to the time requiredto generate the first thread.
 11. The computer system of claim 10,further comprising: releasing the last thread from the optimal number ofthreads upon determining that the one or more computations correspondingto the last thread are iteratively distributed between a remainingoptimal number of threads.
 12. The computer system of claim 7, whereinthe total time required to execute the one or more computations is basedon the one or more computations in one or more threads corresponding tothe determined optimal number of threads.
 13. A non-transitory computerreadable storage medium tangibly storing instructions, which whenexecuted by a computer, cause the computer to execute operationscomprising: receive a request to execute a business process; determinean optimal number of threads for executing the business process by athread optimization model; and iteratively distribute one or morecomputations in the determined optimal number of threads by aninter-thread optimization model, comprising: determining a time requiredto generate a first thread from the optimal number of threads, and atotal time required to execute one or more computations in the generatedfirst thread; and partitioning the one or more computations in thegenerated first thread into one or more time slots, wherein the one ormore time slots are at least equal to the time required to generate thefirst thread; and based on the determined optimal number of threads andthe iterative distribution of the one or more computations, optimize theexecution of the business process.
 14. The non-transitory computerreadable storage medium of claim 13, wherein determining the optimalnumber of threads for executing the business process by the threadoptimization model, comprises: calculate a total time required toexecute one or more computations associated with the business process byiteratively incrementing a value of a thread count for executing thebusiness process; and for each iteration, compare the calculated totaltime and a corresponding value of the thread count to determine theoptimal number of threads for executing the business process.
 15. Thenon-transitory computer readable storage medium of claim 14, wherein thecalculated total time corresponds to a lowest total time for executingthe one or more computations associated with the business process. 16.The non-transitory computer readable storage medium of claim 13, whereiniteratively distributing the one or more computations in the determinedoptimal number of threads by inter-thread optimization model, comprises:determine a time required to generate a first thread from the optimalnumber of threads, and a total time required to execute the one or morecomputations in the generated first thread; and partition the one ormore computations in the optimal number of threads into one or more timeslots, wherein the one or more time slots are equal to the time requiredto generate the first thread.
 17. The non-transitory computer readablestorage medium of claim 16, further storing instructions, which whenexecuted by a computer, cause the computer to execute operationscomprising: release the last thread from the optimal number of threadsupon determining that the one or more computations corresponding to thelast thread are iteratively distributed between a remaining optimalnumber of threads.